<?php $this->load->view('common/default_header.php');?>
<?php $this->load->view('common/nav.php');?>
<section class="trade">
    <ul class="trade-head">
        <li class="br text-center">
            <h4>我的账户</h4>
            <h2><a href="/user"><span class="cny">￥<?php echo $user_info['cny'];?></span></a></h2>
        </li>
        <li class="text-center">
            <h4>体验券</h4>
            <h2><a href="/ticket"><span class="ticket"><?php echo $user_info['ticket'];?></span></a></h2>
        </li>
        <div class="clear"></div>
    </ul>
    <div class="table-responsive">
        <table class="table table-striped">
            <tr>
                <th>日期</th>
                <th>品种</th>
                <th>开仓价</th>
                <th>平仓价</th>
                <th>数量</th>
                <th>盈亏</th>
            </tr>
            <?php 
                if(!empty($records)){
                foreach($records as $data){
                    $kpName = ($data['kp']=='open')?"开":"";
            ?>
                <tr>
                    <td><?php echo date('m-d',strtotime($data['date']));?></td>
                    <td><?php echo $productArr[$data['name']]['desc_sm'];?></td>
                    <td><?php echo del0($data['chi_price']);?>&nbsp;<?php echo ($data['bs']=='bid')?"<i class='red'>↑</i>":"<i class='green'>↓</i>";?></td>
                    <td><?php echo del0($data['cj_price']);?></td>
                    <td><?php echo $data['num'];?><?php echo ($data['dtype']=='ticket')?"张":"手";?></td>
                    <td><font class="<?php echo ($data['yk']<=0)?'green':'red';?>"><?php if($data['yk']>0){echo '+';}?><?php echo del0($data['yk']);?></font></td>
                </tr>
            <?php }?>
            <?php }else{?>
                <tr>
                    <td colspan="6">暂无记录</td>
                </tr>
            <?php }?>
        </table>
    </div>
    <div class="tj_tip">
        <p>只提供最近一个月的数据查询</p>
    </div>
</section>

<?php $this->load->view('common/wx_share.php');?>